import { Button } from 'antd'
import React, { useEffect } from 'react'
import E from 'wangeditor'
export default function Profile () {
    let editor
    useEffect(() => {
      editor =new E('#editor')
      editor.config.zIndex = 0
      editor.create()

      return () => {
        editor.destroy()
        editor = null
      }
    }, [])
  
  const getData=()=>{
    if (editor) {
      console.log(editor.txt.html())
    }
  }
  return (
      <div>
        个人中心页面
        个人简介
        <div id="editor" ></div>
        <Button type="primary" onClick={getData}>获取富文本编辑器数据</Button>
      </div>
  )
    
  
}
